<template>
    <div class="title-wrapper1">
      <div class="box-title">
        <div>
          <i class="iconfont ico" v-html="icon" v-if="icon"></i>
          {{ title }} 
          <slot name="titleOther"></slot>
        </div>
        <div v-if="isMore" class="more" @click="handleGetMoreData">更多</div>
        <div v-if="isOther">
          <slot name="other"></slot>
        </div>
      </div>
      <slot></slot>
    </div>
  </template>
  
  <script>
  export default {
    name: 'BoxWithTitle',
    props: {
      title: {
        type: String,
        default: ''
      },
      icon:{
        type: String,
        default: ''
      },
      isMore:{
        type:Boolean,
        default:false
      },
      isFilter:{
        type:Boolean,
        default:false
      },
      isOther:{
        type:Boolean,
        default:false
      },
    },
    methods:{
      handleGetMoreData(){
        this.$emit('handleGetMoreData')
      },
      handleTitleBtnClick(){
        this.$emit('handleTitleBtnClick')
      }
    }
  }
  </script>
  
  <style scoped lang="scss">
  .title-wrapper1 {
    background:rgba(255,255,255,0.6);
    border-radius: 5px;
    padding:0 10px;
    .box-title{
        line-height:45px;
        width: 100%;
        height: 45px;
        border-bottom: 1px solid rgba(0,0,0,.1);
        color:#5c8ced;
        font-weight: bold;
        display:flex;
        flex-direction: row;
        justify-content: space-between;
   }
   .ico{
    margin-right: 2px;
    color:#5c8ced;
    font-weight: normal;
    font-size: 22px;
    vertical-align: middle;
   }
   .more{
    &:hover{
      cursor: pointer;
    }
   }
  }
  </style>